package com.mhc.haval.manager.impl;

import com.subaru.common.query.PageResult;
import com.mhc.haval.dal.model.DeptBizAreaDO;
import com.mhc.haval.dal.query.DeptBizAreaQuery;
import com.mhc.haval.dal.mapper.ext.DeptBizAreaExtMapper;
import com.mhc.haval.manager.DeptBizAreaManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for DeptBizArea.
 */

@Component
public class DeptBizAreaManagerImpl implements DeptBizAreaManager{

    
    @Autowired
    protected DeptBizAreaExtMapper deptBizAreaExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(DeptBizAreaQuery query){
        return deptBizAreaExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(DeptBizAreaQuery query){
        return deptBizAreaExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(DeptBizAreaDO record){
        return deptBizAreaExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(DeptBizAreaDO record){
        return deptBizAreaExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<DeptBizAreaDO> selectByQuery(DeptBizAreaQuery query){
        return deptBizAreaExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<DeptBizAreaDO> selectByQueryWithPage(DeptBizAreaQuery query) {
        PageResult<DeptBizAreaDO> result = new PageResult<DeptBizAreaDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public DeptBizAreaDO selectByPrimaryKey(Long id){
        return deptBizAreaExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( DeptBizAreaDO record,  DeptBizAreaQuery query){
        return deptBizAreaExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( DeptBizAreaDO record,  DeptBizAreaQuery query){

        return deptBizAreaExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(DeptBizAreaDO record){
        return deptBizAreaExtMapper.updateByPrimaryKeySelective(record);
    }
}